package com.auxgroup.smarthome.configuration;


import com.auxgroup.smarthome.mqtt.AuxMqttClient;
import com.auxgroup.smarthome.mqtt.MqttConfProp;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Qiuhua Lai
 * @email qhlai@gizwits
 */
@Configuration
@EnableConfigurationProperties(MqttConfProp.class)
public class MqttConfiguration {

    /**
     * 注册mqtt连接器
     *
     * @param mqttConfProp
     * @return
     */
    @Bean
    public AuxMqttClient getMqtt(MqttConfProp mqttConfProp) {
        return new AuxMqttClient(mqttConfProp);
    }
}
